Import('env')
Import('options')
env = env.Copy()

sourceFiles = [
    'intern/BLI_dynstr.c',
    'intern/BLI_ghash.c',
    'intern/edgehash.c',
    'intern/BLI_linklist.c',
    'intern/BLI_memarena.c',
    'intern/arithb.c',
    'intern/dynlib.c',
    'intern/fileops.c',
    'intern/gsqueue.c',
    'intern/matrixops.c',
    'intern/noise.c',
    'intern/psfont.c',
    'intern/rand.c',
    'intern/rct.c',
    'intern/scanfill.c',
    'intern/storage.c',
    'intern/time.c',
    'intern/util.c',
    'intern/vectorops.c',
    'intern/freetypefont.c',
    'intern/winstuff.c',
]

if env['USE_INTERNATIONAL']:
    Import('freetypeEnv')
    env = freetypeEnv.Copy()
    env.Append(CPPDEFINES='WITH_FREETYPE2')

env.Append(CPPPATH=[
    '../blenlib',
    '../makesdna',
    '../blenkernel',
    '#/intern/guardedalloc',
    '../include',
])
env.Append(CPPPATH=Flatten(
    # XXX: the old code *prepended* this, what the hell?
    env['FREETYPE_INCLUDE'] +
    env['Z_INCLUDE']
))
env.Library(target='#$BUILD_DIR/lib/blender_blenlib', source=sourceFiles)
